<?php
require_once('BpMonFunctional.php');

########### 1. Declare WSDL Service Server ################################################
$server = new soap_server();
$ws_server_url = 'url';
$server->configureWSDL('BpMonWebService.wsdl', $ws_server_url);

########### 2. Declare Parameter Complex Type #############################################
	include('BpMonComplexType.php');

########### 3. Register Any Functions ####################################################
$server->register("doHellow", array('name' => 'xsd:string'), array('return' => 'xsd:string'));
$server->register("newBPValue", array('pid' => 'xsd:string', 'bphigh' => 'xsd:string', 'bplow' => 'xsd:string'), array('return' => 'xsd:string'));
$server->register("testResObject", array('name' => 'xsd:string'), array('return' => 'tns:Product'));
$server->register("testResObjectArray", array('name' => 'xsd:string'), array('return' => 'tns:ProductArray'));
$server->register("getSysDateTime", array('private_key'=> 'xsd:string'), array('return' => 'tns:WSSysDateTime'));
$server->register("searchUserList", array('private_key'=> 'xsd:string', 'name' => 'xsd:string'), array('return' => 'tns:UserArray'));
$server->register("getBPHistory", array('private_key'=> 'xsd:string', 'name' => 'xsd:string'), array('return' => 'tns:BPHistoryArray'));
$server->register("saveUserData",	array('private_key'=> 'xsd:string', 
											'userid' => 'xsd:string', 
											'systolic' => 'xsd:string', 
											'diastolic' => 'xsd:string', 
											'pulse' => 'xsd:string'
										), 
									array('return' => 'tns:WSStatus'));

########### 4. Service Response ##########################################################
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>